#include <stdio.h>
int main()
{
	int str[100],n,i,p,count,j,arr[10],k=0;
	char c;
	while((c=getchar())-'0')
	{ 
	n=c-'0';
	for(i=k;i<n+k;i++)
	{
		scanf("%d",&str[i]);
		p=1;
		if(str[i]%2==0){
		for(j=2;j<=str[i];j+=2)
		{
			p*=j;
		}
		count=0;
		while(p%2==0)
		{
			count++;
			p/=2;		
		}
	}
	else
	{
		count=0;
	}
		arr[i]=count;
	}
	k=i;
	}
	for(i=0;i<k;i++)
	{
		printf("%d\n",arr[i]);
	}
	return 0;
}
